package xiaoqianlang.util;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * @Author：xiaoqianlang
 * @Package：xiaoqianlang.util
 * @Project：PasswordManage
 * @name：PasswordUtil
 * @Date：2025/4/3/周四 14:31
 * @Filename：PasswordUtil
 */
public class PasswordUtil {
    private static final BCryptPasswordEncoder encoder =new BCryptPasswordEncoder();

    //加密密码
    public static String encodePassword(String rawPassword){
        return encoder.encode(rawPassword);
    }
    //验证密码
    public static boolean verifyPassword(String rawPassword,String encodePassword){
        return encoder.matches(rawPassword,encodePassword);
    }
}
